package com.syn.vr.adapter;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.core.content.ContextCompat;

import com.gaoyi.basemodule.baseAdapter.BaseWidgetAdapter;
import com.syn.vr.R;
import com.syn.vr.bean.ShortDto;
import com.syn.vr.databinding.PopupTvBinding;

import java.util.List;

public class PopupShortAdapter extends BaseWidgetAdapter<PopupTvBinding, ShortDto> {
    public PopupShortAdapter(Context context, List<ShortDto> list) {
        super(context, list);
    }

    @Override
    protected void initView(PopupTvBinding binding, ShortDto item, int position) {
        binding.tvPopup.setText(item.getName());
        binding.tvPopup.setTextColor(ContextCompat.getColor(mContext, item.getSelect() ? R.color.color_main : R.color.black));
    }

    @Override
    protected PopupTvBinding getViewBinding(LayoutInflater inflater, ViewGroup viewGroup) {
        return PopupTvBinding.inflate(inflater, viewGroup, false);
    }
}
